<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>开发管理 - 一体化作战平台</title>
    <!-- 引入Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- 引入Font Awesome -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <!-- 引入Chart.js -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.8/dist/chart.umd.min.js"></script>
    
    <!-- Tailwind配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#0066cc',
                        secondary: '#0099cc',
                        success: '#009966',
                        warning: '#ff9900',
                        danger: '#cc3300',
                        neutral: {
                            100: '#f5f7fa',
                            200: '#e4e7ed',
                            300: '#c0c4cc',
                            400: '#909399',
                            500: '#606266',
                            600: '#303133',
                            700: '#1f2937',
                        }
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                    boxShadow: {
                        'card': '0 2px 8px rgba(0, 0, 0, 0.08)',
                        'dropdown': '0 4px 16px rgba(0, 0, 0, 0.12)',
                    }
                },
            }
        }
    </script>
    
    <!-- 自定义工具类 -->
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .scrollbar-hide {
                -ms-overflow-style: none;
                scrollbar-width: none;
            }
            .scrollbar-hide::-webkit-scrollbar {
                display: none;
            }
            .text-shadow {
                text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            }
            .transition-all-300 {
                transition: all 300ms ease-in-out;
            }
        }
    </style>
</head>
<body class="bg-neutral-100 font-sans text-neutral-600 min-h-screen flex flex-col">
    <!-- 顶部导航栏 -->
    <header class="bg-white shadow-sm fixed top-0 left-0 right-0 z-50">
        <div class="flex items-center justify-between px-4 py-3">
            <!-- Logo和标题 -->
            <div class="flex items-center space-x-3">
                <div class="w-10 h-10 bg-primary rounded-md flex items-center justify-center text-white">
                    <i class="fa fa-bank text-xl"></i>
                </div>
                <h1 class="text-xl font-bold text-neutral-700 hidden md:block">一体化作战平台</h1>
                <h1 class="text-lg font-bold text-neutral-700 md:hidden">研发交付平台</h1>
            </div>
            
            <!-- 搜索框 -->
            <div class="hidden md:flex relative flex-1 max-w-md mx-4">
                <input type="text" placeholder="搜索任务..." 
                    class="w-full pl-10 pr-4 py-2 rounded-md border border-neutral-200 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary">
                <i class="fa fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-neutral-400"></i>
            </div>
            
            <!-- 右侧用户区域 -->
            <div class="flex items-center space-x-1 md:space-x-4">
                <!-- 通知按钮 -->
                <button class="relative p-2 rounded-full hover:bg-neutral-100 transition-all-300">
                    <i class="fa fa-bell-o text-lg text-neutral-600"></i>
                    <span class="absolute top-0 right-0 w-2 h-2 bg-danger rounded-full"></span>
                </button>
                
                <!-- 消息按钮 -->
                <button class="relative p-2 rounded-full hover:bg-neutral-100 transition-all-300 hidden md:block">
                    <i class="fa fa-envelope-o text-lg text-neutral-600"></i>
                    <span class="absolute top-0 right-0 w-2 h-2 bg-primary rounded-full"></span>
                </button>
                
                <!-- 用户头像 -->
                <div class="flex items-center space-x-2 ml-2">
                    <div class="w-8 h-8 bg-neutral-200 rounded-full overflow-hidden">
                        <img src="https://picsum.photos/id/1005/200/200" alt="用户头像" class="w-full h-full object-cover">
                    </div>
                    <span class="hidden md:block text-sm font-medium text-neutral-700">张三</span>
                </div>
            </div>
        </div>
    </header>

    <!-- 主体内容 -->
    <div class="flex pt-16 flex-1">
        <!-- 左侧导航菜单 -->
        <aside class="w-16 md:w-64 bg-white shadow-sm fixed h-full left-0 top-16 overflow-y-auto scrollbar-hide transform md:transform-none transition-transform duration-300 z-40 -translate-x-full md:translate-x-0">
            <nav class="py-4">
                <ul>
                    <!-- 主导航项 -->
                    <li class="mb-1">
                        <a href="index.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-tachometer text-lg"></i>
                            <span class="hidden md:block">首页</span>
                        </a>
                    </li>
                    
                    <!-- 交付流程模块 -->
                    <li class="mb-1">
                        <a href="business_strategy.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-line-chart text-lg"></i>
                            <span class="hidden md:block">业务战略</span>
                        </a>
                    </li>
                    
                    <li class="mb-1">
                        <a href="architecture-management.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-sitemap text-lg"></i>
                            <span class="hidden md:block">架构管理</span>
                        </a>
                    </li>
                    
                    <li class="mb-1">
                        <a href="requirementsManagement.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-list-alt text-lg"></i>
                            <span class="hidden md:block">需求管理</span>
                        </a>
                    </li>
                    
                    <li class="mb-1">
                        <div class="design-menu-wrapper">
                            <div class="flex items-center justify-between px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                                <a href="design_management.html" class="flex items-center space-x-3 flex-1" onclick="event.stopPropagation();">
                                    <i class="fa fa-paint-brush text-lg"></i>
                                    <span class="hidden md:block">设计管理</span>
                                </a>
                                <button id="design-menu-toggle" class="hidden md:block p-1 hover:bg-neutral-200 rounded transition-all" aria-label="展开/收起子菜单" onclick="event.stopPropagation();">
                                    <i class="fa fa-chevron-right text-xs transform transition-transform duration-300"></i>
                                </button>
                            </div>
                            <!-- 下拉子菜单 -->
                            <div id="design-submenu" class="hidden overflow-hidden transition-all duration-300 ease-in-out">
                                <div class="bg-neutral-50 py-1">
                                    <a href="interface_management.html" class="flex items-center space-x-3 px-4 py-2 pl-12 text-neutral-600 hover:bg-primary/5 hover:text-primary transition-all text-sm">
                                        <i class="fa fa-plug text-sm"></i>
                                        <span class="hidden md:block">接口管理</span>
                                    </a>
                                    <a href="model_management.html" class="flex items-center space-x-3 px-4 py-2 pl-12 text-neutral-600 hover:bg-primary/5 hover:text-primary transition-all text-sm">
                                        <i class="fa fa-cubes text-sm"></i>
                                        <span class="hidden md:block">模型管理</span>
                                    </a>
                                    <a href="data_management.html" class="flex items-center space-x-3 px-4 py-2 pl-12 text-neutral-600 hover:bg-primary/5 hover:text-primary transition-all text-sm">
                                        <i class="fa fa-database text-sm"></i>
                                        <span class="hidden md:block">字典管理</span>
                                    </a>
                                    <a href="ui_management.html" class="flex items-center space-x-3 px-4 py-2 pl-12 text-neutral-600 hover:bg-primary/5 hover:text-primary transition-all text-sm">
                                        <i class="fa fa-desktop text-sm"></i>
                                        <span class="hidden md:block">差异分析</span>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </li>
                    
                    <li class="mb-1">
                        <a href="schedule_management.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-calendar text-lg"></i>
                            <span class="hidden md:block">排期管理</span>
                        </a>
                    </li>
                    
                    <li class="mb-1">
                        <a href="developmentMage.html" class="flex items-center space-x-3 px-4 py-3 text-primary bg-primary/5 border-r-4 border-primary">
                            <i class="fa fa-code text-lg"></i>
                            <span class="hidden md:block font-medium">开发管理</span>
                        </a>
                    </li>
                    
                    <li class="mb-1">
                        <div class="test-menu-wrapper">
                            <div class="flex items-center justify-between px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                                <a href="testManagement.html" class="flex items-center space-x-3 flex-1" onclick="event.stopPropagation();">
                                    <i class="fa fa-bug text-lg"></i>
                                    <span class="hidden md:block">测试管理</span>
                                </a>
                                <button id="test-menu-toggle" class="hidden md:block p-1 hover:bg-neutral-200 rounded transition-all" aria-label="展开/收起子菜单" onclick="event.stopPropagation();">
                                    <i class="fa fa-chevron-right text-xs transform transition-transform duration-300"></i>
                                </button>
                            </div>
                            <!-- 下拉子菜单 -->
                            <div id="test-submenu" class="hidden overflow-hidden transition-all duration-300 ease-in-out">
                                <div class="bg-neutral-50 py-1">
                                    <a href="test_cases.html" class="flex items-center space-x-3 px-4 py-2 pl-12 text-neutral-600 hover:bg-primary/5 hover:text-primary transition-all text-sm">
                                        <i class="fa fa-file-text-o text-sm"></i>
                                        <span class="hidden md:block">测试案例</span>
                                    </a>
                                    <a href="test_plans.html" class="flex items-center space-x-3 px-4 py-2 pl-12 text-neutral-600 hover:bg-primary/5 hover:text-primary transition-all text-sm">
                                        <i class="fa fa-calendar-check-o text-sm"></i>
                                        <span class="hidden md:block">测试计划</span>
                                    </a>
                                    <a href="test_reports.html" class="flex items-center space-x-3 px-4 py-2 pl-12 text-neutral-600 hover:bg-primary/5 hover:text-primary transition-all text-sm">
                                        <i class="fa fa-bar-chart text-sm"></i>
                                        <span class="hidden md:block">测试报告</span>
                                    </a>
                                    <a href="test_global_settings.html" class="flex items-center space-x-3 px-4 py-2 pl-12 text-neutral-600 hover:bg-primary/5 hover:text-primary transition-all text-sm">
                                        <i class="fa fa-cogs text-sm"></i>
                                        <span class="hidden md:block">全局设置</span>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </li>
                    
                    <li class="mb-1">
                        <a href="production_workflow.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-rocket text-lg"></i>
                            <span class="hidden md:block">投产上线</span>
                        </a>
                    </li>
                    
                    <!-- 新增的三个子菜单项 -->
                    <li class="mb-1">
                        <a href="quality_management.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-check-circle text-lg"></i>
                            <span class="hidden md:block">质量管理</span>
                        </a>
                    </li>
                    
                    <li class="mb-1">
                        <a href="security_management.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-shield text-lg"></i>
                            <span class="hidden md:block">安全管理</span>
                        </a>
                    </li>
                    
                    <li class="mb-1">
                        <a href="efficiency_metrics.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-bar-chart text-lg"></i>
                            <span class="hidden md:block">效能度量</span>
                        </a>
                    </li>
                    
                    <!-- 分隔线 -->
                    <li class="my-2">
                        <div class="border-t border-neutral-200 mx-4"></div>
                    </li>
                    
                    <!-- 公共模块 -->
                    <li class="mb-1">
                        <a href="teamManagement.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-users text-lg"></i>
                            <span class="hidden md:block">团队管理</span>
                        </a>
                    </li>
                    
                    <li class="mb-1">
                        <a href="settings.html" class="flex items-center space-x-3 px-4 py-3 text-neutral-600 hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-cog text-lg"></i>
                            <span class="hidden md:block">设置</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </aside>

        <!-- 主内容区域 -->
        <main class="flex-1 ml-16 md:ml-64 p-4 md:p-6 bg-neutral-100 min-h-screen">
            <!-- 面包屑导航 -->
            <div class="mb-6">
                <nav class="flex" aria-label="面包屑">
                    <ol class="inline-flex items-center space-x-1 md:space-x-3">
                        <li class="inline-flex items-center">
                            <a href="index.html" class="inline-flex items-center text-sm font-medium text-neutral-500 hover:text-primary">
                                <i class="fa fa-home mr-2"></i>
                                首页
                            </a>
                        </li>
                        <li>
                            <div class="flex items-center">
                                <i class="fa fa-chevron-right text-neutral-400 text-xs mx-2"></i>
                                <span class="text-sm font-medium text-primary">开发管理</span>
                            </div>
                        </li>
                    </ol>
                </nav>
            </div>

            <!-- 页面标题 -->
            <div class="flex justify-between items-center mb-6">
                <h1 class="text-2xl font-bold text-neutral-700">开发管理</h1>
                <button class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                    <i class="fa fa-plus mr-2"></i>新建流水线
                </button>
            </div>

            <!-- 我的系统部分 -->
            <section class="mb-8">
                <div class="flex justify-between items-center mb-4">
                    <h2 class="text-lg font-bold text-neutral-700">我的系统</h2>
                    <div class="flex space-x-2">
                        <button class="px-3 py-1 text-sm border border-neutral-200 rounded-md hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-refresh mr-1"></i>刷新
                        </button>
                        <button class="px-3 py-1 text-sm border border-neutral-200 rounded-md hover:bg-neutral-50 transition-all-300">
                            <i class="fa fa-cog mr-1"></i>设置
                        </button>
                    </div>
                </div>
                
                <!-- 系统卡片列表 -->
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6">
                    <!-- 系统卡片1 -->
                    <div class="bg-white rounded-lg shadow-card p-4 transition-all-300 hover:shadow-lg cursor-pointer system-card" data-system-id="1" data-system-name="个人存款系统" onclick="openSystemModal(this)">
                        <div class="flex justify-between items-start mb-4">
                            <div class="flex items-center space-x-3">
                                <div class="w-10 h-10 bg-primary/10 rounded-md flex items-center justify-center text-primary">
                                    <i class="fa fa-database text-xl"></i>
                                </div>
                                <div>
                                    <h3 class="font-bold text-neutral-700">个人存款系统</h3>
                                    <p class="text-sm text-neutral-500">后端服务</p>
                                </div>
                            </div>
                            <div class="dropdown relative">
                                <button class="text-neutral-400 hover:text-neutral-600 p-1">
                                    <i class="fa fa-ellipsis-v"></i>
                                </button>
                            </div>
                        </div>
                        
                        <!-- 流水线模板 -->
                        <div class="mb-4">
                            <p class="text-sm text-neutral-500 mb-2">可用流水线模板</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="px-3 py-1 text-xs bg-primary/10 text-primary rounded-full cursor-pointer hover:bg-primary/20 transition-all-300">
                                    Java后端服务
                                </span>
                                <span class="px-3 py-1 text-xs bg-secondary/10 text-secondary rounded-full cursor-pointer hover:bg-secondary/20 transition-all-300">
                                    Docker容器部署
                                </span>
                                <span class="px-3 py-1 text-xs bg-success/10 text-success rounded-full cursor-pointer hover:bg-success/20 transition-all-300">
                                    数据库变更
                                </span>
                            </div>
                        </div>
                        
                        <!-- 操作按钮 -->
                        <div class="flex space-x-2">
                            <button class="flex-1 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300 text-sm">
                                <i class="fa fa-play-circle mr-1"></i>运行流水线
                            </button>
                            <button class="w-10 h-10 flex items-center justify-center border border-neutral-200 rounded-md hover:bg-neutral-50 transition-all-300">
                                <i class="fa fa-history text-neutral-600"></i>
                            </button>
                        </div>
                    </div>
                    
                    <!-- 系统卡片2 -->
                    <div class="bg-white rounded-lg shadow-card p-4 transition-all-300 hover:shadow-lg cursor-pointer system-card" data-system-id="2" data-system-name="贷款审批系统" onclick="openSystemModal(this)">
                        <div class="flex justify-between items-start mb-4">
                            <div class="flex items-center space-x-3">
                                <div class="w-10 h-10 bg-secondary/10 rounded-md flex items-center justify-center text-secondary">
                                    <i class="fa fa-credit-card text-xl"></i>
                                </div>
                                <div>
                                    <h3 class="font-bold text-neutral-700">贷款审批系统</h3>
                                    <p class="text-sm text-neutral-500">前后端分离应用</p>
                                </div>
                            </div>
                            <div class="dropdown relative">
                                <button class="text-neutral-400 hover:text-neutral-600 p-1">
                                    <i class="fa fa-ellipsis-v"></i>
                                </button>
                            </div>
                        </div>
                        
                        <!-- 流水线模板 -->
                        <div class="mb-4">
                            <p class="text-sm text-neutral-500 mb-2">可用流水线模板</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="px-3 py-1 text-xs bg-primary/10 text-primary rounded-full cursor-pointer hover:bg-primary/20 transition-all-300">
                                    Java后端服务
                                </span>
                                <span class="px-3 py-1 text-xs bg-warning/10 text-warning rounded-full cursor-pointer hover:bg-warning/20 transition-all-300">
                                    Vue前端应用
                                </span>
                                <span class="px-3 py-1 text-xs bg-secondary/10 text-secondary rounded-full cursor-pointer hover:bg-secondary/20 transition-all-300">
                                    Docker容器部署
                                </span>
                                <span class="px-3 py-1 text-xs bg-success/10 text-success rounded-full cursor-pointer hover:bg-success/20 transition-all-300">
                                    数据库变更
                                </span>
                            </div>
                        </div>
                        
                        <!-- 操作按钮 -->
                        <div class="flex space-x-2">
                            <button class="flex-1 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300 text-sm">
                                <i class="fa fa-play-circle mr-1"></i>运行流水线
                            </button>
                            <button class="w-10 h-10 flex items-center justify-center border border-neutral-200 rounded-md hover:bg-neutral-50 transition-all-300">
                                <i class="fa fa-history text-neutral-600"></i>
                            </button>
                        </div>
                    </div>
                    
                    <!-- 系统卡片3 -->
                    <div class="bg-white rounded-lg shadow-card p-4 transition-all-300 hover:shadow-lg cursor-pointer system-card" data-system-id="3" data-system-name="数据分析平台" onclick="openSystemModal(this)">
                        <div class="flex justify-between items-start mb-4">
                            <div class="flex items-center space-x-3">
                                <div class="w-10 h-10 bg-warning/10 rounded-md flex items-center justify-center text-warning">
                                    <i class="fa fa-line-chart text-xl"></i>
                                </div>
                                <div>
                                    <h3 class="font-bold text-neutral-700">数据分析平台</h3>
                                    <p class="text-sm text-neutral-500">数据服务</p>
                                </div>
                            </div>
                            <div class="dropdown relative">
                                <button class="text-neutral-400 hover:text-neutral-600 p-1">
                                    <i class="fa fa-ellipsis-v"></i>
                                </button>
                            </div>
                        </div>
                        
                        <!-- 流水线模板 -->
                        <div class="mb-4">
                            <p class="text-sm text-neutral-500 mb-2">可用流水线模板</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="px-3 py-1 text-xs bg-danger/10 text-danger rounded-full cursor-pointer hover:bg-danger/20 transition-all-300">
                                    Python服务
                                </span>
                                <span class="px-3 py-1 text-xs bg-secondary/10 text-secondary rounded-full cursor-pointer hover:bg-secondary/20 transition-all-300">
                                    Docker容器部署
                                </span>
                                <span class="px-3 py-1 text-xs bg-success/10 text-success rounded-full cursor-pointer hover:bg-success/20 transition-all-300">
                                    数据同步
                                </span>
                            </div>
                        </div>
                        
                        <!-- 操作按钮 -->
                        <div class="flex space-x-2">
                            <button class="flex-1 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300 text-sm">
                                <i class="fa fa-play-circle mr-1"></i>运行流水线
                            </button>
                            <button class="w-10 h-10 flex items-center justify-center border border-neutral-200 rounded-md hover:bg-neutral-50 transition-all-300">
                                <i class="fa fa-history text-neutral-600"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </section>

            <!-- 流水线模板库 -->
            <section class="mb-8">
                <div class="flex justify-between items-center mb-4">
                    <h2 class="text-lg font-bold text-neutral-700">流水线模板库</h2>
                    <div class="relative">
                        <select class="appearance-none pl-3 pr-8 py-1 border border-neutral-200 rounded-md focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary text-sm">
                            <option>按发布单元类型筛选</option>
                            <option>后端服务</option>
                            <option>前端应用</option>
                            <option>数据库变更</option>
                            <option>数据服务</option>
                            <option>微服务</option>
                        </select>
                        <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-neutral-500">
                            <i class="fa fa-chevron-down text-xs"></i>
                        </div>
                    </div>
                </div>
                
                <!-- 模板卡片列表 -->
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 md:gap-6">
                    <!-- 模板1 -->
                    <div class="bg-white rounded-lg shadow-card overflow-hidden transition-all-300 hover:shadow-lg">
                        <div class="h-2 bg-primary"></div>
                        <div class="p-4">
                            <div class="flex items-center space-x-2 mb-3">
                                <div class="w-8 h-8 bg-primary/10 rounded-md flex items-center justify-center text-primary">
                                    <i class="fa fa-code"></i>
                                </div>
                                <h3 class="font-bold text-neutral-700">Java后端服务</h3>
                            </div>
                            <p class="text-sm text-neutral-600 mb-4">适用于Spring Boot等Java后端服务的标准流水线，包含编译、测试、打包、部署等流程。</p>
                            <div class="flex justify-between items-center">
                                <div class="flex space-x-1">
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">后端服务</span>
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">Java</span>
                                </div>
                                <button class="px-3 py-1 text-xs bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                                    <i class="fa fa-plus mr-1"></i>使用模板
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 模板2 -->
                    <div class="bg-white rounded-lg shadow-card overflow-hidden transition-all-300 hover:shadow-lg">
                        <div class="h-2 bg-warning"></div>
                        <div class="p-4">
                            <div class="flex items-center space-x-2 mb-3">
                                <div class="w-8 h-8 bg-warning/10 rounded-md flex items-center justify-center text-warning">
                                    <i class="fa fa-desktop"></i>
                                </div>
                                <h3 class="font-bold text-neutral-700">Vue前端应用</h3>
                            </div>
                            <p class="text-sm text-neutral-600 mb-4">适用于Vue.js前端应用的标准流水线，包含依赖安装、构建、静态资源部署等流程。</p>
                            <div class="flex justify-between items-center">
                                <div class="flex space-x-1">
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">前端应用</span>
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">Vue</span>
                                </div>
                                <button class="px-3 py-1 text-xs bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                                    <i class="fa fa-plus mr-1"></i>使用模板
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 模板3 -->
                    <div class="bg-white rounded-lg shadow-card overflow-hidden transition-all-300 hover:shadow-lg">
                        <div class="h-2 bg-secondary"></div>
                        <div class="p-4">
                            <div class="flex items-center space-x-2 mb-3">
                                <div class="w-8 h-8 bg-secondary/10 rounded-md flex items-center justify-center text-secondary">
                                    <i class="fa fa-cubes"></i>
                                </div>
                                <h3 class="font-bold text-neutral-700">Docker容器部署</h3>
                            </div>
                            <p class="text-sm text-neutral-600 mb-4">适用于Docker容器化应用的部署流水线，包含镜像构建、推送、容器部署等流程。</p>
                            <div class="flex justify-between items-center">
                                <div class="flex space-x-1">
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">容器化</span>
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">部署</span>
                                </div>
                                <button class="px-3 py-1 text-xs bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                                    <i class="fa fa-plus mr-1"></i>使用模板
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 模板4 -->
                    <div class="bg-white rounded-lg shadow-card overflow-hidden transition-all-300 hover:shadow-lg">
                        <div class="h-2 bg-success"></div>
                        <div class="p-4">
                            <div class="flex items-center space-x-2 mb-3">
                                <div class="w-8 h-8 bg-success/10 rounded-md flex items-center justify-center text-success">
                                    <i class="fa fa-database"></i>
                                </div>
                                <h3 class="font-bold text-neutral-700">数据库变更</h3>
                            </div>
                            <p class="text-sm text-neutral-600 mb-4">适用于数据库 schema 变更的流水线，包含SQL审查、备份、执行、回滚等流程。</p>
                            <div class="flex justify-between items-center">
                                <div class="flex space-x-1">
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">数据库</span>
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">变更</span>
                                </div>
                                <button class="px-3 py-1 text-xs bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                                    <i class="fa fa-plus mr-1"></i>使用模板
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 模板5 -->
                    <div class="bg-white rounded-lg shadow-card overflow-hidden transition-all-300 hover:shadow-lg">
                        <div class="h-2 bg-danger"></div>
                        <div class="p-4">
                            <div class="flex items-center space-x-2 mb-3">
                                <div class="w-8 h-8 bg-danger/10 rounded-md flex items-center justify-center text-danger">
                                    <i class="fa fa-terminal"></i>
                                </div>
                                <h3 class="font-bold text-neutral-700">Python服务</h3>
                            </div>
                            <p class="text-sm text-neutral-600 mb-4">适用于Python服务的标准流水线，包含依赖安装、测试、打包、部署等流程。</p>
                            <div class="flex justify-between items-center">
                                <div class="flex space-x-1">
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">后端服务</span>
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">Python</span>
                                </div>
                                <button class="px-3 py-1 text-xs bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                                    <i class="fa fa-plus mr-1"></i>使用模板
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 模板6 -->
                    <div class="bg-white rounded-lg shadow-card overflow-hidden transition-all-300 hover:shadow-lg">
                        <div class="h-2 bg-neutral-600"></div>
                        <div class="p-4">
                            <div class="flex items-center space-x-2 mb-3">
                                <div class="w-8 h-8 bg-neutral-100 rounded-md flex items-center justify-center text-neutral-600">
                                    <i class="fa fa-exchange"></i>
                                </div>
                                <h3 class="font-bold text-neutral-700">数据同步</h3>
                            </div>
                            <p class="text-sm text-neutral-600 mb-4">适用于数据同步任务的流水线，包含数据源连接、数据转换、数据加载等流程。</p>
                            <div class="flex justify-between items-center">
                                <div class="flex space-x-1">
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">数据服务</span>
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">同步</span>
                                </div>
                                <button class="px-3 py-1 text-xs bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                                    <i class="fa fa-plus mr-1"></i>使用模板
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 模板7 -->
                    <div class="bg-white rounded-lg shadow-card overflow-hidden transition-all-300 hover:shadow-lg">
                        <div class="h-2 bg-primary"></div>
                        <div class="p-4">
                            <div class="flex items-center space-x-2 mb-3">
                                <div class="w-8 h-8 bg-primary/10 rounded-md flex items-center justify-center text-primary">
                                    <i class="fa fa-cloud"></i>
                                </div>
                                <h3 class="font-bold text-neutral-700">微服务部署</h3>
                            </div>
                            <p class="text-sm text-neutral-600 mb-4">适用于微服务架构的部署流水线，包含服务注册、配置管理、灰度发布等流程。</p>
                            <div class="flex justify-between items-center">
                                <div class="flex space-x-1">
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">微服务</span>
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">部署</span>
                                </div>
                                <button class="px-3 py-1 text-xs bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                                    <i class="fa fa-plus mr-1"></i>使用模板
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 模板8 -->
                    <div class="bg-white rounded-lg shadow-card overflow-hidden transition-all-300 hover:shadow-lg">
                        <div class="h-2 bg-success"></div>
                        <div class="p-4">
                            <div class="flex items-center space-x-2 mb-3">
                                <div class="w-8 h-8 bg-success/10 rounded-md flex items-center justify-center text-success">
                                    <i class="fa fa-file-code-o"></i>
                                </div>
                                <h3 class="font-bold text-neutral-700">静态网站</h3>
                            </div>
                            <p class="text-sm text-neutral-600 mb-4">适用于静态网站的部署流水线，包含构建、CDN同步、缓存刷新等流程。</p>
                            <div class="flex justify-between items-center">
                                <div class="flex space-x-1">
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">前端应用</span>
                                    <span class="px-2 py-0.5 text-xs bg-neutral-100 text-neutral-600 rounded">静态</span>
                                </div>
                                <button class="px-3 py-1 text-xs bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                                    <i class="fa fa-plus mr-1"></i>使用模板
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </section>

            <!-- 最近运行的流水线 -->
            <section>
                <div class="flex justify-between items-center mb-4">
                    <h2 class="text-lg font-bold text-neutral-700">最近运行的流水线</h2>
                    <a href="#all-pipelines" class="text-primary text-sm hover:underline">查看全部</a>
                </div>
                
                <!-- 流水线运行记录表格 -->
                <div class="bg-white rounded-lg shadow-card overflow-hidden">
                    <div class="overflow-x-auto">
                        <table class="min-w-full">
                            <thead class="bg-neutral-50">
                                <tr>
                                    <th class="px-4 py-3 text-left text-xs font-medium text-neutral-500 uppercase tracking-wider">流水线名称</th>
                                    <th class="px-4 py-3 text-left text-xs font-medium text-neutral-500 uppercase tracking-wider">所属系统</th>
                                    <th class="px-4 py-3 text-left text-xs font-medium text-neutral-500 uppercase tracking-wider">状态</th>
                                    <th class="px-4 py-3 text-left text-xs font-medium text-neutral-500 uppercase tracking-wider">触发人</th>
                                    <th class="px-4 py-3 text-left text-xs font-medium text-neutral-500 uppercase tracking-wider">开始时间</th>
                                    <th class="px-4 py-3 text-left text-xs font-medium text-neutral-500 uppercase tracking-wider">持续时间</th>
                                    <th class="px-4 py-3 text-right text-xs font-medium text-neutral-500 uppercase tracking-wider">操作</th>
                                </tr>
                            </thead>
                            <tbody class="divide-y divide-neutral-200">
                                <!-- 流水线记录1 -->
                                <tr>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <div class="w-8 h-8 bg-primary/10 rounded-md flex items-center justify-center text-primary mr-3">
                                                <i class="fa fa-code"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-neutral-700">个人存款系统构建</div>
                                                <div class="text-xs text-neutral-500">#128</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="text-sm text-neutral-700">个人存款系统</div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <span class="px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full bg-success/10 text-success">
                                            成功
                                        </span>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <img class="w-6 h-6 rounded-full mr-2" src="https://picsum.photos/id/1005/200/200" alt="触发人">
                                            <span class="text-sm text-neutral-700">张三</span>
                                        </div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="text-sm text-neutral-700">2023-06-15 09:30</div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="text-sm text-neutral-700">4m 23s</div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap text-right text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">查看</button>
                                        <button class="text-neutral-500 hover:text-neutral-700">重试</button>
                                    </td>
                                </tr>
                                
                                <!-- 流水线记录2 -->
                                <tr>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <div class="w-8 h-8 bg-warning/10 rounded-md flex items-center justify-center text-warning mr-3">
                                                <i class="fa fa-desktop"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-neutral-700">贷款审批前端部署</div>
                                                <div class="text-xs text-neutral-500">#85</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="text-sm text-neutral-700">贷款审批系统</div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <span class="px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full bg-danger/10 text-danger">
                                            失败
                                        </span>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <img class="w-6 h-6 rounded-full mr-2" src="https://picsum.photos/id/1012/200/200" alt="触发人">
                                            <span class="text-sm text-neutral-700">李四</span>
                                        </div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="text-sm text-neutral-700">2023-06-15 08:45</div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="text-sm text-neutral-700">2m 17s</div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap text-right text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">查看</button>
                                        <button class="text-neutral-500 hover:text-neutral-700">重试</button>
                                    </td>
                                </tr>
                                
                                <!-- 流水线记录3 -->
                                <tr>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <div class="w-8 h-8 bg-success/10 rounded-md flex items-center justify-center text-success mr-3">
                                                <i class="fa fa-database"></i>
                                            </div>
                                            <div>
                                                <div class="text-sm font-medium text-neutral-700">数据分析平台数据同步</div>
                                                <div class="text-xs text-neutral-500">#42</div>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="text-sm text-neutral-700">数据分析平台</div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <span class="px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full bg-neutral-100 text-neutral-600">
                                            运行中
                                        </span>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <img class="w-6 h-6 rounded-full mr-2" src="https://picsum.photos/id/1025/200/200" alt="触发人">
                                            <span class="text-sm text-neutral-700">王五</span>
                                        </div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="text-sm text-neutral-700">2023-06-15 07:10</div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap">
                                        <div class="text-sm text-neutral-700">15m 08s</div>
                                    </td>
                                    <td class="px-4 py-3 whitespace-nowrap text-right text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">查看</button>
                                        <button class="text-danger hover:text-danger/80">终止</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </section>
        </main>
    </div>

    <!-- 流水线详情模态框 -->
    <div id="pipelineDetailModal" class="fixed inset-0 bg-black/50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] overflow-hidden flex flex-col">
            <!-- 模态框头部 -->
            <div class="px-6 py-4 border-b border-neutral-200 flex justify-between items-center">
                <h3 id="modalTitle" class="text-xl font-bold text-neutral-700">流水线详情</h3>
                <button id="closeModalBtn" class="text-neutral-500 hover:text-neutral-700">
                    <i class="fa fa-times text-lg"></i>
                </button>
            </div>
            
            <!-- 模态框内容 -->
            <div class="px-6 py-4 overflow-y-auto flex-1">
                <!-- 流水线基本信息 -->
                <div class="mb-6">
                    <div class="flex justify-between items-center mb-2">
                        <div class="flex items-center">
                            <div id="modalPipelineIcon" class="w-8 h-8 bg-primary/10 rounded-md flex items-center justify-center text-primary mr-3">
                                <i class="fa fa-code"></i>
                            </div>
                            <h4 id="modalPipelineName" class="text-lg font-semibold text-neutral-700">个人存款系统构建</h4>
                        </div>
                        <span id="modalPipelineStatus" class="px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full bg-success/10 text-success">
                            成功
                        </span>
                    </div>
                    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 text-sm">
                        <div class="flex items-center">
                            <i class="fa fa-clock-o text-neutral-400 mr-2"></i>
                            <span>开始时间: <span id="modalStartTime" class="font-medium">2023-06-15 09:30</span></span>
                        </div>
                        <div class="flex items-center">
                            <i class="fa fa-hourglass-half text-neutral-400 mr-2"></i>
                            <span>持续时间: <span id="modalDuration" class="font-medium">4m 23s</span></span>
                        </div>
                        <div class="flex items-center">
                            <i class="fa fa-user text-neutral-400 mr-2"></i>
                            <span>触发人: <span id="modalTrigger" class="font-medium">张三</span></span>
                        </div>
                        <div class="flex items-center">
                            <i class="fa fa-cubes text-neutral-400 mr-2"></i>
                            <span>所属系统: <span id="modalSystem" class="font-medium">个人存款系统</span></span>
                        </div>
                    </div>
                </div>
                
                <!-- 流水线节点信息 -->
                <div>
                    <h4 class="text-lg font-semibold text-neutral-700 mb-4">流水线执行节点</h4>
                    <div id="pipelineNodes" class="space-y-6">
                        <!-- 节点1: 检出 -->
                        <div class="relative pl-8 pb-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">1-1 检出</h5>
                                    <span class="text-xs text-neutral-500">耗时: 30s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">从代码仓库检出</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">检出结果:</p>
                                    <p class="text-neutral-700">成功检出代码，分支: master，提交ID: a1b2c3d4e5f6</p>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 节点2: 单元测试 -->
                        <div class="relative pl-8 pb-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">2-1 单元测试</h5>
                                    <span class="text-xs text-neutral-500">耗时: 2m 15s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">执行Shell脚本</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">测试结果:</p>
                                    <p class="text-neutral-700">执行120个测试用例，通过率85%，失败18个测试用例，跳过5个测试用例</p>
                                    <div class="mt-2 h-2 bg-neutral-200 rounded-full overflow-hidden">
                                        <div class="h-full bg-success" style="width: 85%"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 节点3: 编译 -->
                        <div class="relative pl-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">3-1 编译</h5>
                                    <span class="text-xs text-neutral-500">耗时: 1m 38s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">执行Shell脚本</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">编译结果:</p>
                                    <p class="text-neutral-700">编译成功，生成24个类文件，3个jar包，总大小: 45MB</p>
                                    <p class="text-success mt-1">没有编译错误或警告</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 模态框底部 -->
            <div class="px-6 py-4 border-t border-neutral-200 flex justify-end space-x-3">
                <button class="px-4 py-2 border border-neutral-200 text-neutral-600 rounded-md hover:bg-neutral-50 transition-all-300">
                    下载日志
                </button>
                <button class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                    <i class="fa fa-refresh mr-1"></i>重新运行
                </button>
            </div>
        </div>
    </div>

    <!-- 系统代码仓库管理模态框 -->
    <div id="systemRepoModal" class="fixed inset-0 bg-black/50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] overflow-hidden flex flex-col">
            <!-- 模态框头部 -->
            <div class="px-6 py-4 border-b border-neutral-200 flex justify-between items-center">
                <h3 id="systemModalTitle" class="text-xl font-bold text-neutral-700">系统代码仓库管理</h3>
                <button id="closeSystemModalBtn" class="text-neutral-500 hover:text-neutral-700">
                    <i class="fa fa-times text-lg"></i>
                </button>
            </div>
            
            <!-- 模态框内容 -->
            <div id="systemModalContent" class="px-6 py-4 overflow-y-auto flex-1">
                <!-- 代码仓库列表视图 -->
                <div id="repoListView">
                    <div class="flex justify-between items-center mb-6">
                        <div>
                            <h4 class="text-lg font-semibold text-neutral-700 mb-1">当前系统关联的代码仓库</h4>
                            <p class="text-sm text-neutral-500">共 <span id="repoCount">3</span> 个代码仓库</p>
                        </div>
                        <button id="createRepoBtn" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                            <i class="fa fa-plus mr-2"></i>创建新代码仓库
                        </button>
                    </div>
                    
                    <!-- 代码仓库列表 -->
                    <div id="repoList" class="space-y-4">
                        <!-- 动态生成的代码仓库列表 -->
                    </div>
                </div>
                
                <!-- 创建代码仓库表单视图 -->
                <div id="createRepoFormView" class="hidden">
                    <div class="flex items-center justify-between mb-6">
                        <div class="flex items-center">
                            <button id="backToListBtn" class="mr-3 text-neutral-500 hover:text-neutral-700">
                                <i class="fa fa-arrow-left text-lg"></i>
                            </button>
                            <h4 class="text-lg font-semibold text-neutral-700">创建新代码仓库</h4>
                        </div>
                    </div>
                    
                    <form id="createRepoForm" class="space-y-6">
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <!-- 发布单元类型 -->
                            <div>
                                <label class="block text-sm font-medium text-neutral-700 mb-2">
                                    发布单元类型 <span class="text-danger">*</span>
                                </label>
                                <div class="relative">
                                    <select id="releaseUnitType" class="w-full appearance-none pl-4 pr-10 py-3 border border-neutral-200 rounded-md focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary" required>
                                        <option value="">请选择发布单元类型</option>
                                        <option value="backend">后端服务</option>
                                        <option value="frontend">前端应用</option>
                                        <option value="database">数据库变更</option>
                                        <option value="dataservice">数据服务</option>
                                        <option value="batch">批处理服务</option>
                                        <option value="fex">fex服务</option>
                                    </select>
                                    <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-3 text-neutral-400">
                                        <i class="fa fa-chevron-down text-sm"></i>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- 构建工具 -->
                            <div>
                                <label class="block text-sm font-medium text-neutral-700 mb-2">
                                    构建工具 <span class="text-danger">*</span>
                                </label>
                                <div class="relative">
                                    <select id="buildTool" class="w-full appearance-none pl-4 pr-10 py-3 border border-neutral-200 rounded-md focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary" required>
                                        <option value="">请选择构建工具</option>
                                        <option value="maven">Maven</option>
                                        <option value="gradle">Gradle</option>
                                        <option value="npm">NPM</option>
                                        <option value="other">其他</option>
                                    </select>
                                    <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-3 text-neutral-400">
                                        <i class="fa fa-chevron-down text-sm"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 部署方式 -->
                        <div>
                            <label class="block text-sm font-medium text-neutral-700 mb-3">
                                部署方式 <span class="text-danger">*</span>
                            </label>
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                                <label class="flex items-center p-4 border border-neutral-200 rounded-md cursor-pointer hover:bg-neutral-50 transition-all-300">
                                    <input type="radio" name="deploymentType" value="container" class="mr-3" required>
                                    <div>
                                        <div class="font-medium text-neutral-700">容器化部署</div>
                                        <div class="text-sm text-neutral-500">使用Docker容器进行部署</div>
                                    </div>
                                </label>
                                <label class="flex items-center p-4 border border-neutral-200 rounded-md cursor-pointer hover:bg-neutral-50 transition-all-300">
                                    <input type="radio" name="deploymentType" value="vm" class="mr-3" required>
                                    <div>
                                        <div class="font-medium text-neutral-700">虚拟机部署</div>
                                        <div class="text-sm text-neutral-500">直接在虚拟机上部署</div>
                                    </div>
                                </label>
                            </div>
                        </div>
                        
                        <!-- 提交按钮 -->
                        <div class="flex justify-end space-x-3 pt-4">
                            <button type="button" id="cancelCreateBtn" class="px-4 py-2 border border-neutral-200 text-neutral-600 rounded-md hover:bg-neutral-50 transition-all-300">
                                取消
                            </button>
                            <button type="submit" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                                <i class="fa fa-plus mr-1"></i>创建代码仓库
                            </button>
                        </div>
                    </form>
                </div>
                
                <!-- 创建日志视图 -->
                <div id="createLogView" class="hidden">
                    <div class="flex items-center justify-between mb-6">
                        <h4 class="text-lg font-semibold text-neutral-700">正在创建代码仓库...</h4>
                        <div class="flex items-center text-primary">
                            <i class="fa fa-spinner fa-spin mr-2"></i>
                            <span class="text-sm">创建中</span>
                        </div>
                    </div>
                    
                    <!-- 日志区域 -->
                    <div class="bg-neutral-900 rounded-md p-4 font-mono text-sm text-green-400 max-h-96 overflow-y-auto">
                        <div id="logContainer">
                            <!-- 动态生成的日志内容 -->
                        </div>
                    </div>
                </div>
                
                <!-- 创建成功视图 -->
                <div id="createSuccessView" class="hidden">
                    <div class="text-center mb-6">
                        <div class="w-16 h-16 bg-success/10 rounded-full flex items-center justify-center text-success mx-auto mb-4">
                            <i class="fa fa-check text-2xl"></i>
                        </div>
                        <h4 class="text-xl font-semibold text-neutral-700 mb-2">代码仓库创建成功!</h4>
                        <p class="text-neutral-600">新的代码仓库已经成功创建并配置完成</p>
                    </div>
                    
                    <!-- 新创建的代码仓库信息 -->
                    <div id="newRepoInfo" class="bg-neutral-50 rounded-lg p-6">
                        <!-- 动态生成的代码仓库信息 -->
                    </div>
                    
                    <div class="flex justify-center mt-6">
                        <button id="closeSuccessBtn" class="px-6 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-all-300">
                            关闭
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- JavaScript代码 -->
    <script>
        // 为流水线模板添加点击事件
        document.querySelectorAll('.pipeline-template').forEach(template => {
            template.addEventListener('click', function() {
                // 在实际应用中，这里会打开一个创建流水线的表单
                alert(`正在使用模板创建流水线: ${this.dataset.name}`);
            });
        });
        
        // 为系统卡片中的流水线模板添加点击事件
        document.querySelectorAll('.system-card .flex-wrap span').forEach(template => {
            template.addEventListener('click', function() {
                // 在实际应用中，这里会打开一个创建流水线的表单，并预填充所选模板
                const systemName = this.closest('.system-card').querySelector('h3').textContent;
                const templateName = this.textContent.trim();
                alert(`为系统 "${systemName}" 使用模板 "${templateName}" 创建流水线`);
            });
        });
        
        // 为"运行流水线"按钮添加点击事件
        document.querySelectorAll('.run-pipeline-btn').forEach(button => {
            button.addEventListener('click', function() {
                // 在实际应用中，这里会打开一个运行流水线的确认对话框
                const systemName = this.closest('.system-card').querySelector('h3').textContent;
                alert(`正在为系统 "${systemName}" 运行默认流水线`);
            });
        });
        
        // 流水线详情模态框相关
        const modal = document.getElementById('pipelineDetailModal');
        const closeModalBtn = document.getElementById('closeModalBtn');
        const modalTitle = document.getElementById('modalTitle');
        const modalPipelineName = document.getElementById('modalPipelineName');
        const modalPipelineStatus = document.getElementById('modalPipelineStatus');
        const modalPipelineIcon = document.getElementById('modalPipelineIcon');
        const modalStartTime = document.getElementById('modalStartTime');
        const modalDuration = document.getElementById('modalDuration');
        const modalTrigger = document.getElementById('modalTrigger');
        const modalSystem = document.getElementById('modalSystem');
        const pipelineNodes = document.getElementById('pipelineNodes');
        
        // 为所有"查看"按钮添加点击事件
        document.querySelectorAll('td button:first-child').forEach(button => {
            button.addEventListener('click', function() {
                const row = this.closest('tr');
                const pipelineInfo = row.querySelector('td:first-child');
                const pipelineName = pipelineInfo.querySelector('.text-sm.font-medium').textContent;
                const pipelineId = pipelineInfo.querySelector('.text-xs').textContent;
                const systemName = row.querySelector('td:nth-child(2) .text-sm').textContent;
                const statusElement = row.querySelector('td:nth-child(3) span');
                const status = statusElement.textContent.trim();
                const triggerInfo = row.querySelector('td:nth-child(4)');
                const triggerName = triggerInfo.querySelector('span').textContent;
                const startTime = row.querySelector('td:nth-child(5) .text-sm').textContent;
                const duration = row.querySelector('td:nth-child(6) .text-sm').textContent;
                
                // 更新模态框内容
                modalTitle.textContent = `流水线详情 - ${pipelineName}`;
                modalPipelineName.textContent = `${pipelineName} ${pipelineId}`;
                modalSystem.textContent = systemName;
                modalStartTime.textContent = startTime;
                modalDuration.textContent = duration;
                modalTrigger.textContent = triggerName;
                
                // 更新状态样式
                modalPipelineStatus.className = statusElement.className;
                modalPipelineStatus.textContent = status;
                
                // 根据不同流水线更新节点信息
                if (pipelineName.includes('个人存款系统')) {
                    // 个人存款系统构建流水线节点
                    pipelineNodes.innerHTML = `
                        <!-- 节点1: 检出 -->
                        <div class="relative pl-8 pb-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">1-1 检出</h5>
                                    <span class="text-xs text-neutral-500">耗时: 30s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">从代码仓库检出</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">检出结果:</p>
                                    <p class="text-neutral-700">成功检出代码，分支: master，提交ID: a1b2c3d4e5f6</p>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 节点2: 单元测试 -->
                        <div class="relative pl-8 pb-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">2-1 单元测试</h5>
                                    <span class="text-xs text-neutral-500">耗时: 2m 15s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">执行Shell脚本</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">测试结果:</p>
                                    <p class="text-neutral-700">执行120个测试用例，通过率85%，失败18个测试用例，跳过5个测试用例</p>
                                    <div class="mt-2 h-2 bg-neutral-200 rounded-full overflow-hidden">
                                        <div class="h-full bg-success" style="width: 85%"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 节点3: 编译 -->
                        <div class="relative pl-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">3-1 编译</h5>
                                    <span class="text-xs text-neutral-500">耗时: 1m 38s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">执行Shell脚本</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">编译结果:</p>
                                    <p class="text-neutral-700">编译成功，生成24个类文件，3个jar包，总大小: 45MB</p>
                                    <p class="text-success mt-1">没有编译错误或警告</p>
                                </div>
                            </div>
                        </div>
                    `;
                } else if (pipelineName.includes('贷款审批前端')) {
                    // 贷款审批前端部署流水线节点
                    pipelineNodes.innerHTML = `
                        <!-- 节点1: 检出 -->
                        <div class="relative pl-8 pb-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">1-1 检出</h5>
                                    <span class="text-xs text-neutral-500">耗时: 25s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">从代码仓库检出</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">检出结果:</p>
                                    <p class="text-neutral-700">成功检出代码，分支: feature/ui-upgrade，提交ID: f9e8d7c6b5a4</p>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 节点2: 依赖安装 -->
                        <div class="relative pl-8 pb-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">2-1 依赖安装</h5>
                                    <span class="text-xs text-neutral-500">耗时: 45s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">执行npm install</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">安装结果:</p>
                                    <p class="text-neutral-700">成功安装124个依赖包，其中生产环境依赖89个，开发环境依赖35个</p>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 节点3: 构建 -->
                        <div class="relative pl-8 pb-8 border-l-2 border-danger">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-danger flex items-center justify-center text-white">
                                <i class="fa fa-times text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">3-1 构建</h5>
                                    <span class="text-xs text-neutral-500">耗时: 37s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">执行npm run build</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">构建结果:</p>
                                    <p class="text-danger">构建失败，发现8个编译错误</p>
                                    <p class="text-neutral-700 mt-1">错误信息: Module not found: Error: Can't resolve 'vue-router' in '/src/router'</p>
                                </div>
                            </div>
                        </div>
                    `;
                } else {
                    // 数据分析平台数据同步流水线节点
                    pipelineNodes.innerHTML = `
                        <!-- 节点1: 数据源连接 -->
                        <div class="relative pl-8 pb-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">1-1 数据源连接</h5>
                                    <span class="text-xs text-neutral-500">耗时: 1m 10s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">连接主数据库和数据仓库</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">连接结果:</p>
                                    <p class="text-neutral-700">成功连接到MySQL主数据库和PostgreSQL数据仓库</p>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 节点2: 数据抽取 -->
                        <div class="relative pl-8 pb-8 border-l-2 border-primary">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-primary flex items-center justify-center text-white">
                                <i class="fa fa-check text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">2-1 数据抽取</h5>
                                    <span class="text-xs text-neutral-500">耗时: 5m 25s</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">从主数据库抽取数据</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">抽取结果:</p>
                                    <p class="text-neutral-700">成功抽取15个表的数据，共2,568,432条记录</p>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 节点3: 数据转换 -->
                        <div class="relative pl-8 border-l-2 border-neutral-300">
                            <div class="absolute left-[-10px] top-0 w-5 h-5 rounded-full bg-neutral-300 flex items-center justify-center text-white">
                                <i class="fa fa-spinner fa-spin text-xs"></i>
                            </div>
                            <div class="mb-2">
                                <div class="flex justify-between items-center">
                                    <h5 class="font-medium text-neutral-700">3-1 数据转换</h5>
                                    <span class="text-xs text-neutral-500">耗时: 8m 33s (运行中)</span>
                                </div>
                                <p class="text-sm text-neutral-600 mt-1">数据清洗和转换</p>
                                <div class="mt-2 text-xs bg-neutral-50 p-3 rounded-md">
                                    <p class="text-neutral-500 mb-1">转换进度:</p>
                                    <p class="text-neutral-700">已处理1,852,345条记录，预计剩余时间: 3m 15s</p>
                                    <div class="mt-2 h-2 bg-neutral-200 rounded-full overflow-hidden">
                                        <div class="h-full bg-neutral-400" style="width: 72%"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    `;
                }
                
                // 显示模态框
                modal.classList.remove('hidden');
                
                // 防止背景滚动
                document.body.style.overflow = 'hidden';
            });
        });
        
        // 关闭模态框
        closeModalBtn.addEventListener('click', function() {
            modal.classList.add('hidden');
            document.body.style.overflow = '';
        });
        
        // 点击模态框外部关闭
        modal.addEventListener('click', function(e) {
            if (e.target === modal) {
                modal.classList.add('hidden');
                document.body.style.overflow = '';
            }
        });
        
        // 按ESC键关闭模态框
        document.addEventListener('keydown', function(e) {
            if (e.key === 'Escape' && !modal.classList.contains('hidden')) {
                modal.classList.add('hidden');
                document.body.style.overflow = '';
            }
        });
        
        // ===== 系统代码仓库管理模态框功能 =====
        const systemModal = document.getElementById('systemRepoModal');
        const closeSystemModalBtn = document.getElementById('closeSystemModalBtn');
        const systemModalTitle = document.getElementById('systemModalTitle');
        const repoListView = document.getElementById('repoListView');
        const createRepoFormView = document.getElementById('createRepoFormView');
        const createLogView = document.getElementById('createLogView');
        const createSuccessView = document.getElementById('createSuccessView');
        const createRepoBtn = document.getElementById('createRepoBtn');
        const backToListBtn = document.getElementById('backToListBtn');
        const cancelCreateBtn = document.getElementById('cancelCreateBtn');
        const createRepoForm = document.getElementById('createRepoForm');
        const closeSuccessBtn = document.getElementById('closeSuccessBtn');
        const repoList = document.getElementById('repoList');
        const repoCount = document.getElementById('repoCount');
        const logContainer = document.getElementById('logContainer');
        const newRepoInfo = document.getElementById('newRepoInfo');
        
        // 系统代码仓库数据
        const systemRepoData = {
            '1': {
                name: '个人存款系统',
                repos: [
                    { 
                        name: 'deposit-service-backend',
                        type: '后端服务',
                        description: '个人存款业务后端服务',
                        tech: 'Java Spring Boot',
                        status: '运行中',
                        lastUpdate: '2小时前'
                    },
                    { 
                        name: 'deposit-web-frontend',
                        type: '前端应用',
                        description: '个人存款业务前端界面',
                        tech: 'Vue.js',
                        status: '运行中',
                        lastUpdate: '1天前'
                    },
                    { 
                        name: 'deposit-database-migration',
                        type: '数据库变更',
                        description: '数据库结构变更脚本',
                        tech: 'SQL',
                        status: '待部署',
                        lastUpdate: '3天前'
                    }
                ]
            },
            '2': {
                name: '贷款审批系统',
                repos: [
                    { 
                        name: 'loan-approval-service',
                        type: '后端服务',
                        description: '贷款审批业务逻辑服务',
                        tech: 'Java Spring Boot',
                        status: '运行中',
                        lastUpdate: '30分钟前'
                    },
                    { 
                        name: 'loan-approval-ui',
                        type: '前端应用',
                        description: '贷款审批管理界面',
                        tech: 'Vue.js',
                        status: '运行中',
                        lastUpdate: '2小时前'
                    },
                    { 
                        name: 'loan-risk-engine',
                        type: '数据服务',
                        description: '风险评估计算引擎',
                        tech: 'Python',
                        status: '运行中',
                        lastUpdate: '1小时前'
                    },
                    { 
                        name: 'loan-batch-processor',
                        type: '批处理服务',
                        description: '批量贷款处理任务',
                        tech: 'Java',
                        status: '运行中',
                        lastUpdate: '4小时前'
                    }
                ]
            },
            '3': {
                name: '数据分析平台',
                repos: [
                    { 
                        name: 'analytics-api-service',
                        type: '后端服务',
                        description: '数据分析API服务',
                        tech: 'Python Flask',
                        status: '运行中',
                        lastUpdate: '1小时前'
                    },
                    { 
                        name: 'analytics-dashboard',
                        type: '前端应用',
                        description: '数据可视化仪表板',
                        tech: 'React',
                        status: '运行中',
                        lastUpdate: '3小时前'
                    },
                    { 
                        name: 'data-etl-pipeline',
                        type: '数据服务',
                        description: 'ETL数据处理流水线',
                        tech: 'Apache Airflow',
                        status: '运行中',
                        lastUpdate: '6小时前'
                    }
                ]
            }
        };
        
        let currentSystemId = null;
        
        // 打开系统代码仓库模态框
        window.openSystemModal = function(element) {
            const systemId = element.getAttribute('data-system-id');
            const systemName = element.getAttribute('data-system-name');
            currentSystemId = systemId;
            
            // 更新模态框标题
            systemModalTitle.textContent = `${systemName} - 代码仓库管理`;
            
            // 显示仓库列表
            showRepoList();
            
            // 显示模态框
            systemModal.classList.remove('hidden');
            document.body.style.overflow = 'hidden';
        };
        
        // 显示代码仓库列表
        function showRepoList() {
            const systemData = systemRepoData[currentSystemId];
            if (!systemData) return;
            
            // 更新仓库数量
            repoCount.textContent = systemData.repos.length;
            
            // 生成仓库列表HTML
            repoList.innerHTML = systemData.repos.map(repo => `
                <div class="bg-white border border-neutral-200 rounded-lg p-4 hover:shadow-md transition-all-300">
                    <div class="flex justify-between items-start mb-3">
                        <div class="flex items-center space-x-3">
                            <div class="w-10 h-10 ${getRepoIconColor(repo.type)} rounded-md flex items-center justify-center text-white">
                                <i class="fa ${getRepoIcon(repo.type)}"></i>
                            </div>
                            <div>
                                <h5 class="font-semibold text-neutral-700">${repo.name}</h5>
                                <p class="text-sm text-neutral-500">${repo.description}</p>
                            </div>
                        </div>
                        <span class="px-2 py-1 text-xs rounded-full ${getStatusColor(repo.status)}">
                            ${repo.status}
                        </span>
                    </div>
                    <div class="flex justify-between items-center text-sm text-neutral-500">
                        <div class="flex space-x-4">
                            <span><i class="fa fa-tag mr-1"></i>${repo.type}</span>
                            <span><i class="fa fa-code mr-1"></i>${repo.tech}</span>
                            <span><i class="fa fa-clock-o mr-1"></i>${repo.lastUpdate}</span>
                        </div>
                        <div class="flex space-x-2">
                            <button class="text-primary hover:text-primary/80">
                                <i class="fa fa-external-link"></i>
                            </button>
                            <button class="text-neutral-500 hover:text-neutral-700">
                                <i class="fa fa-cog"></i>
                            </button>
                        </div>
                    </div>
                </div>
            `).join('');
            
            // 显示仓库列表视图
            hideAllViews();
            repoListView.classList.remove('hidden');
        }
        
        // 获取仓库图标
        function getRepoIcon(type) {
            const icons = {
                '后端服务': 'fa-code',
                '前端应用': 'fa-desktop',
                '数据库变更': 'fa-database',
                '数据服务': 'fa-line-chart',
                '批处理服务': 'fa-refresh',
                'fex服务': 'fa-cloud'
            };
            return icons[type] || 'fa-file-code-o';
        }
        
        // 获取仓库图标颜色
        function getRepoIconColor(type) {
            const colors = {
                '后端服务': 'bg-primary',
                '前端应用': 'bg-warning',
                '数据库变更': 'bg-success',
                '数据服务': 'bg-secondary',
                '批处理服务': 'bg-danger',
                'fex服务': 'bg-neutral-600'
            };
            return colors[type] || 'bg-neutral-400';
        }
        
        // 获取状态颜色
        function getStatusColor(status) {
            const colors = {
                '运行中': 'bg-success/10 text-success',
                '待部署': 'bg-warning/10 text-warning',
                '已停止': 'bg-neutral-100 text-neutral-600',
                '错误': 'bg-danger/10 text-danger'
            };
            return colors[status] || 'bg-neutral-100 text-neutral-600';
        }
        
        // 隐藏所有视图
        function hideAllViews() {
            [repoListView, createRepoFormView, createLogView, createSuccessView].forEach(view => {
                view.classList.add('hidden');
            });
        }
        
        // 显示创建仓库表单
        createRepoBtn.addEventListener('click', function() {
            hideAllViews();
            createRepoFormView.classList.remove('hidden');
            // 重置表单
            createRepoForm.reset();
        });
        
        // 返回仓库列表
        backToListBtn.addEventListener('click', function() {
            showRepoList();
        });
        
        // 取消创建
        cancelCreateBtn.addEventListener('click', function() {
            showRepoList();
        });
        
        // 提交创建表单
        createRepoForm.addEventListener('submit', function(e) {
            e.preventDefault();
            
            const formData = new FormData(createRepoForm);
            const releaseUnitType = document.getElementById('releaseUnitType').value;
            const buildTool = document.getElementById('buildTool').value;
            const deploymentType = formData.get('deploymentType');
            
            // 显示创建日志视图
            hideAllViews();
            createLogView.classList.remove('hidden');
            
            // 清空日志容器
            logContainer.innerHTML = '';
            
            // 模拟创建过程
            simulateRepoCreation(releaseUnitType, buildTool, deploymentType);
        });
        
        // 模拟代码仓库创建过程
        function simulateRepoCreation(releaseUnitType, buildTool, deploymentType) {
            const logs = [
                '基于发布单元类型，自动创建组织级代码仓库目录 -- 完成',
                '自动创建Docker模型 -- 完成',
                '自动创建配置中心基于元数据 -- 完成',
                '基于组织级标准流水线模型创建流水线 -- 完成'
            ];
            
            let currentLogIndex = 0;
            
            function addLog() {
                if (currentLogIndex < logs.length) {
                    const logLine = document.createElement('div');
                    logLine.className = 'mb-1';
                    logLine.innerHTML = `<span class="text-neutral-400">[${new Date().toLocaleTimeString()}]</span> ${logs[currentLogIndex]}`;
                    logContainer.appendChild(logLine);
                    
                    // 滚动到底部
                    logContainer.scrollTop = logContainer.scrollHeight;
                    
                    currentLogIndex++;
                    
                    // 间隔500ms显示下一行日志
                    setTimeout(addLog, 500);
                } else {
                    // 所有日志显示完毕，显示成功视图
                    setTimeout(() => {
                        showSuccessView(releaseUnitType, buildTool, deploymentType);
                    }, 1000);
                }
            }
    <script>
        // 设计管理菜单展开/收起功能
        document.addEventListener('DOMContentLoaded', function() {
            const designMenuToggle = document.getElementById('design-menu-toggle');
            const designSubmenu = document.getElementById('design-submenu');
            const designMenuWrapper = document.querySelector('.design-menu-wrapper');
            
            if (designMenuToggle && designSubmenu) {
                designMenuToggle.addEventListener('click', function(e) {
                    e.stopPropagation();
                    this.querySelector('i').classList.toggle('rotate-90');
                    if (designSubmenu.classList.contains('hidden')) {
                        designSubmenu.classList.remove('hidden');
                        setTimeout(() => {
                            designSubmenu.classList.remove('opacity-0');
                        }, 10);
                    } else {
                        designSubmenu.classList.add('opacity-0');
                        setTimeout(() => {
                            designSubmenu.classList.add('hidden');
                        }, 300);
                    }
                });
                
                // 点击菜单项外部区域收起菜单
                document.addEventListener('click', function(e) {
                    if (designMenuWrapper && !designMenuWrapper.contains(e.target)) {
                        designSubmenu.classList.add('opacity-0');
                        setTimeout(() => {
                            designSubmenu.classList.add('hidden');
                        }, 300);
                        if (designMenuToggle.querySelector('i')) {
                            designMenuToggle.querySelector('i').classList.remove('rotate-90');
                        }
                    }
                });
            }
            
            // 测试管理菜单展开/收起功能
            const testMenuToggle = document.getElementById('test-menu-toggle');
            const testSubmenu = document.getElementById('test-submenu');
            const testMenuWrapper = document.querySelector('.test-menu-wrapper');
            
            if (testMenuToggle && testSubmenu) {
                testMenuToggle.addEventListener('click', function(e) {
                    e.stopPropagation();
                    this.querySelector('i').classList.toggle('rotate-90');
                    if (testSubmenu.classList.contains('hidden')) {
                        testSubmenu.classList.remove('hidden');
                        setTimeout(() => {
                            testSubmenu.classList.remove('opacity-0');
                        }, 10);
                    } else {
                        testSubmenu.classList.add('opacity-0');
                        setTimeout(() => {
                            testSubmenu.classList.add('hidden');
                        }, 300);
                    }
                });
                
                // 点击菜单项外部区域收起菜单
                document.addEventListener('click', function(e) {
                    if (testMenuWrapper && !testMenuWrapper.contains(e.target)) {
                        testSubmenu.classList.add('opacity-0');
                        setTimeout(() => {
                            testSubmenu.classList.add('hidden');
                        }, 300);
                        if (testMenuToggle.querySelector('i')) {
                            testMenuToggle.querySelector('i').classList.remove('rotate-90');
                        }
                    }
                });
            }
        });
    </script>
</body>
</html>
            
            // 开始显示日志
            addLog();
        }
        
        // 显示创建成功视图
        function showSuccessView(releaseUnitType, buildTool, deploymentType) {
            hideAllViews();
            createSuccessView.classList.remove('hidden');
            
            // 生成新仓库信息
            const repoName = generateRepoName(releaseUnitType);
            const techStack = getTechStack(releaseUnitType, buildTool);
            const deploymentInfo = getDeploymentInfo(deploymentType);
            
            newRepoInfo.innerHTML = `
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div>
                        <h5 class="font-semibold text-neutral-700 mb-3">仓库基本信息</h5>
                        <div class="space-y-2 text-sm">
                            <div class="flex justify-between">
                                <span class="text-neutral-500">仓库名称:</span>
                                <span class="font-medium">${repoName}</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-neutral-500">发布单元类型:</span>
                                <span class="font-medium">${getTypeLabel(releaseUnitType)}</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-neutral-500">构建工具:</span>
                                <span class="font-medium">${buildTool.toUpperCase()}</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-neutral-500">技术栈:</span>
                                <span class="font-medium">${techStack}</span>
                            </div>
                        </div>
                    </div>
                    <div>
                        <h5 class="font-semibold text-neutral-700 mb-3">部署配置</h5>
                        <div class="space-y-2 text-sm">
                            <div class="flex justify-between">
                                <span class="text-neutral-500">部署方式:</span>
                                <span class="font-medium">${deploymentInfo.name}</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-neutral-500">运行环境:</span>
                                <span class="font-medium">${deploymentInfo.env}</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-neutral-500">流水线模板:</span>
                                <span class="font-medium">${deploymentInfo.template}</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-neutral-500">创建时间:</span>
                                <span class="font-medium">${new Date().toLocaleString()}</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="mt-6 p-4 bg-primary/5 rounded-md">
                    <div class="flex items-center text-primary mb-2">
                        <i class="fa fa-info-circle mr-2"></i>
                        <span class="font-medium">下一步操作</span>
                    </div>
                    <ul class="text-sm text-neutral-600 space-y-1 ml-6">
                        <li>• 代码仓库已自动初始化，可以开始提交代码</li>
                        <li>• 流水线已配置完成，推送代码后将自动触发构建</li>
                        <li>• 可在系统设置中进一步配置环境变量和部署参数</li>
                    </ul>
                </div>
            `;
            
            // 更新系统数据（模拟添加新仓库）
            const newRepo = {
                name: repoName,
                type: getTypeLabel(releaseUnitType),
                description: `基于${getTypeLabel(releaseUnitType)}的新代码仓库`,
                tech: techStack,
                status: '待部署',
                lastUpdate: '刚刚创建'
            };
            
            systemRepoData[currentSystemId].repos.push(newRepo);
        }
        
        // 生成仓库名称
        function generateRepoName(type) {
            const systemName = systemRepoData[currentSystemId].name;
            const typeMap = {
                'backend': 'service',
                'frontend': 'web',
                'database': 'db-migration',
                'dataservice': 'data-service',
                'batch': 'batch-processor',
                'fex': 'fex-service'
            };
            const suffix = typeMap[type] || 'service';
            const timestamp = Date.now().toString().slice(-4);
            return `${systemName.replace(/系统|平台/g, '').toLowerCase()}-${suffix}-${timestamp}`;
        }
        
        // 获取技术栈
        function getTechStack(type, buildTool) {
            const stacks = {
                'backend': buildTool === 'maven' ? 'Java Spring Boot' : buildTool === 'gradle' ? 'Java Spring Boot' : 'Node.js',
                'frontend': 'Vue.js',
                'database': 'MySQL/PostgreSQL',
                'dataservice': 'Python Flask',
                'batch': 'Java',
                'fex': 'Node.js Express'
            };
            return stacks[type] || '多语言';
        }
        
        // 获取部署信息
        function getDeploymentInfo(deploymentType) {
            if (deploymentType === 'container') {
                return {
                    name: '容器化部署',
                    env: 'Docker + Kubernetes',
                    template: 'Docker构建流水线'
                };
            } else {
                return {
                    name: '虚拟机部署',
                    env: 'CentOS 7.x',
                    template: '传统部署流水线'
                };
            }
        }
        
        // 获取类型标签
        function getTypeLabel(type) {
            const labels = {
                'backend': '后端服务',
                'frontend': '前端应用',
                'database': '数据库变更',
                'dataservice': '数据服务',
                'batch': '批处理服务',
                'fex': 'fex服务'
            };
            return labels[type] || type;
        }
        
        // 关闭成功视图
        closeSuccessBtn.addEventListener('click', function() {
            showRepoList();
        });
        
        // 关闭系统模态框
        closeSystemModalBtn.addEventListener('click', function() {
            systemModal.classList.add('hidden');
            document.body.style.overflow = '';
        });
        
        // 点击模态框外部关闭
        systemModal.addEventListener('click', function(e) {
            if (e.target === systemModal) {
                systemModal.classList.add('hidden');
                document.body.style.overflow = '';
            }
        });
        
        // 按ESC键关闭系统模态框
        document.addEventListener('keydown', function(e) {
            if (e.key === 'Escape' && !systemModal.classList.contains('hidden')) {
                systemModal.classList.add('hidden');
                document.body.style.overflow = '';
            }
        });
    </script>
</body>
</html>